from django.forms import ModelForm, DecimalField, CharField, Textarea, ModelChoiceField, ImageField, Form
from main.models import Thumb, Gallery

class ThumbManageForm(ModelForm):
    title = CharField(required=True)
    image = ImageField(required=True)
    description = CharField(required=False,widget=Textarea(attrs={'rows':4}))
    gallery = ModelChoiceField(queryset=Gallery.objects.all())
    price = DecimalField(min_value=0.0, decimal_places=2)
    class Meta:
        model = Thumb
